/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tolls;

/**
 *
 * @author Aggelos
 */
public class CollectTollForm extends javax.swing.JFrame {

    /**
     * Creates new form CollectTollForm
     */
    public CollectTollForm() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jTextField2 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel3 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jTextField1 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLayeredPane3 = new javax.swing.JLayeredPane();
        jTollsBar1 = new javax.swing.JLabel();
        jTollsBar2 = new javax.swing.JLabel();
        jTollsBar3 = new javax.swing.JLabel();
        jTollsBar4 = new javax.swing.JLabel();
        jTollsBar5 = new javax.swing.JLabel();
        jVehicle1 = new javax.swing.JLabel();
        jVehicle2 = new javax.swing.JLabel();
        jVehicle2.setVisible(false);
        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jButton1.setText("ΔΙΕΛΕΥΣΗ");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel2.setText("Αρ. Κάρτας: ");

        jLabel1.setText("Αρ. Κυκλοφορίας");

        jButton2.setText("ΠΛΗΡΩΜΗ");

        jLabel3.setText("Υπόλοιπο Κάρτας: ");

        jTextField1.setBackground(new java.awt.Color(197, 217, 250));
        jTextField1.setFont(new java.awt.Font("Monospaced", 1, 18)); // NOI18N
        jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextField1.setBorder(null);
        jTextField1.setOpaque(false);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });
        jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
        });
        jTextField1.setBounds(40, 0, 90, 40);
        jLayeredPane1.add(jTextField1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/car-sign.PNG"))); // NOI18N
        jLabel4.setText("jLabel4");
        jLabel4.setBounds(10, 0, 150, 40);
        jLayeredPane1.add(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTollsBar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Tolls bar.PNG"))); // NOI18N
        jTollsBar1.setText("jTollsBar1");
        jTollsBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jTollsBar1.setEnabled(false);
        jTollsBar1.setBounds(10, 110, 80, 14);
        jLayeredPane3.add(jTollsBar1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTollsBar2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Tolls bar.PNG"))); // NOI18N
        jTollsBar2.setText("jTollsBar2");
        jTollsBar2.setBounds(110, 110, 90, 14);
        jLayeredPane3.add(jTollsBar2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTollsBar3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Tolls bar.PNG"))); // NOI18N
        jTollsBar3.setText("jTollsBar3");
        jTollsBar3.setEnabled(false);
        jTollsBar3.setBounds(240, 110, 80, 14);
        jLayeredPane3.add(jTollsBar3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTollsBar4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Tolls bar.PNG"))); // NOI18N
        jTollsBar4.setText("jTollsBar4");
        jTollsBar4.setEnabled(false);
        jTollsBar4.setBounds(360, 110, 90, 14);
        jLayeredPane3.add(jTollsBar4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTollsBar5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Tolls bar.PNG"))); // NOI18N
        jTollsBar5.setText("jTollsBar5");
        jTollsBar5.setEnabled(false);
        jTollsBar5.setBounds(470, 110, 60, 14);
        jLayeredPane3.add(jTollsBar5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jVehicle1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/IX.PNG"))); // NOI18N
        jVehicle1.setText("jVehicle1");
        jVehicle1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jVehicle1.setBounds(140, 130, 40, 90);
        jLayeredPane3.add(jVehicle1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jVehicle2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/IX.PNG"))); // NOI18N
        jVehicle2.setText("jVehicle2");
        jVehicle2.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jVehicle2.setBounds(140, 0, 40, 90);
        jLayeredPane3.add(jVehicle2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/avenue/resources/Lanes Gray.PNG"))); // NOI18N
        jLabel6.setText("jLabel6");
        jLabel6.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel6.setBounds(10, 0, 520, 233);
        jLayeredPane3.add(jLabel6, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(jSeparator1))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addGap(17, 17, 17)
                                            .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(layout.createSequentialGroup()
                                            .addGap(60, 60, 60)
                                            .addComponent(jLabel1))
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                            .addComponent(jLabel2)
                                            .addGap(55, 55, 55)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(45, 45, 45)
                                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLayeredPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButton1)
                                    .addComponent(jLabel3))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jButton2))))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLayeredPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
        // TODO add your handling code here:
        String j = jTextField1.getText().toUpperCase(); jTextField1.setText(j); //vV
                                                        //vV Χρήση της μεθόδου toUpperCase() ώστε 
                                                        //vV όταν αφήνει το πλήκτρο που πατά ο 
                                                        //vV χρήστης, το γράμμα που πληκτρολόγησε 
                                                        //vV σε κάθε περίπτωση να μετατραπεί σε 
                                                        //vV κεφαλαίο (ανεξάρτητα από την κατάσταση 
                                                        //vV του Caps Lock ή του Shift)

    }//GEN-LAST:event_jTextField1KeyReleased

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        if (jTollsBar2.isVisible()) {       //vV Όταν γίνει η ενέργεια ΔΙΕΛΕΥΣΗ, τότε  
            jTollsBar2.setVisible(false);   //vV ελέγχει αν η μπάρα των 
            jVehicle2.setVisible(true);     //vV διοδίων jTollsBar2, είναι ορατή
            jVehicle1.setVisible(false);    //vV και αν ναι, τότε την κάνει μη ορατή, 
                                            //vV κάνει το ορατό όχημα μη ορατό και το μη ορατό, 
                                            //vV ορατό. Έτσι φαίνεται ότι ανοίγει η μπάρα και 
                                            //vV διέρχεται το όχημα

        }
        else {
            jTollsBar2.setVisible(true);    //vV Αν η μπάρα των διοδίων jTollsBar2, είναι
            jVehicle2.setVisible(false);    //vV μη ορατή ι, τότε την κάνει ορατή και
            jVehicle1.setVisible(true);     //vV κάνει το μη ορατό όχημα, ορατό και το
                                            //vV ορατό όχημα, μη ορατό
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(CollectTollForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(CollectTollForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(CollectTollForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(CollectTollForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CollectTollForm().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JLayeredPane jLayeredPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JLabel jTollsBar1;
    private javax.swing.JLabel jTollsBar2;
    private javax.swing.JLabel jTollsBar3;
    private javax.swing.JLabel jTollsBar4;
    private javax.swing.JLabel jTollsBar5;
    private javax.swing.JLabel jVehicle1;
    private javax.swing.JLabel jVehicle2;
    // End of variables declaration//GEN-END:variables
}
